package HOT100;

import java.util.Scanner;

/**
 * @author 是阿秋啊
 * @date 2023/03/21 16:56
 **/
public class WuDuan {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int k = sc.nextInt();
        StringBuilder s = new StringBuilder(sc.next());
        int[] arr = isSame(s.toString());
        if (arr[0] == 1) {
            String a = s.substring(0,arr[1]);
            for (int i = 0; i < k - 1; i++) {
                s.append(a);
            }
        } else {
            int lmid, rmid;
            if (s.length() % 2 == 0) {
                lmid = rmid = s.length() / 2;
            } else {
                lmid = s.length() / 2;
                rmid = lmid + 1;
            }
            while (!s.substring(0, lmid).equals(s.substring(rmid))) {
                lmid--;
                rmid++;
            }
            String tmp = s.substring(lmid);
            for (int i = 0; i < k - 1; i++) {
                s.append(tmp);
            }
        }
        System.out.println(s);
    }

    private static int[] isSame(String s) {
        int len = s.length();
        boolean flag = true;
        for (int i = 1; i <= s.length() / 2; i++) {
            String tmp = s.substring(0,i);
            for (int j = i; j < len - i; j+=i) {
                if (!tmp.equals(s.substring(j,j+i))){
                    flag = false;
                    break;
                }
            }
            if (flag){
                return new int[]{1,i};
            }
            flag = true;
        }
        return new int[]{0,0};
    }
}